package com.streambolics.mail;

import com.streambolics.std.CompositeTextBuilder;
import com.streambolics.std.HtmlBuilder;
import com.streambolics.std.SimpleTextBuilder;
import com.streambolics.std.TextBuilder;

public class EmailTextBuilder extends CompositeTextBuilder
{
    private TextBuilder _Html;
    private TextBuilder _Plain;

    public EmailTextBuilder()
    {
        init (new HtmlBuilder (), new SimpleTextBuilder ());
    }

    public EmailTextBuilder(HtmlBuilder aHtml, StringBuilder aPlain)
    {
        init (aHtml, new SimpleTextBuilder (aPlain));
    }

    public String getHtmlString ()
    {
        return _Html.toString ();
    }

    public String getPlainString ()
    {
        return _Plain.toString ();
    }

    private void init (TextBuilder aHtml, TextBuilder aPlain)
    {
        _Html = aHtml;
        _Plain = aPlain;
        addChild (aHtml);
        addChild (aPlain);
    }

}
